package com.hylu.springboot.system.controller;

import com.alibaba.fastjson.JSON;
import com.hylu.springboot.system.pojo.po.Student;
import com.hylu.springboot.system.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 学生类 控制层
 *
 * @author： 鲁大师
 * @date: 2017/12/10
 */
@Controller
public class StudentController {
    @Autowired
    private StudentService studentService;

    @ResponseBody
    @RequestMapping("/getStudent")
    public String getStudent() {
        Student student = studentService.getById(1);
        System.out.println(JSON.toJSONString(student));
        return JSON.toJSONString(student);
    }
}
